package cn.tedu.egmybatis1.mapper;

import cn.tedu.egmybatis1.pojo.entity.Hero;
import cn.tedu.egmybatis1.pojo.vo.HerVo2;
import cn.tedu.egmybatis1.pojo.vo.HeroVo1;
import org.apache.ibatis.annotations.*;

@Mapper
public interface HeroMapper{
    @Insert("INSERT INTO hero (name,age,money) VALUES (#{name},#{age},#{money})")
    int insertHero(Hero hero);

    @Delete("DELETE FROM hero WHERE id=#{id}")
    int deleteHeroById(int id);

    @Select("SELECT name,money FROM hero WHERE id=#{id}")
    HeroVo1 selectById(int id);

    @Select("SELECT name,age,money FROM hero WHERE age=#{age}")
    HerVo2 selectByAge(int age);
}
